version 17
set more off
quietly log
local logon = r(status)
	if "`logon'" == "on"  {
	log close	
	}
log using mkdata_support_for_a_strong_leader_or_democracy, text replace

/*******************************************************************************
	Project   : Support for a strong leader or democracy, or both?
	File Name : mkdata_support_for_a_strong_leader_or_democracy.do
	Date	  : Sep 19th, 2023 (Latest update)
	Purpose	  : Making a dataset for the research project, "Support for a strong
				leader or democracy, or both?" This file is included for reference 
				only. Thus, the final data set is supplied with these data sets
				but not all of the constitutive pieces used to assemble it.
		
	Input	  : 1) WVS_TimeSeries_1981_2020_stata_v2_0.dta - World Value Survey (Wave 1 ~ 7)
				  (https://www.worldvaluessurvey.org/WVSContents.jsp)
				  
				2) V-Dem-CY-Core-v11.1.dta - The V-Dem Dataset
				  (https://www.v-dem.net/vdemds.html)
				  
				3) World bank.csv - World Bank
				  (https://data.worldbank.org/)
				   			
	Output	  : 1) mkdata_support_for_a_strong_leader_or_democracy.log         - Log File
				2) Data_support_for_a_strong_leader_or_democracy.dta           - Final data
					
******************************************************************************  */

**# 1. Calling the main WVS dataset
	use "data/World Value Survey (Wave 1 ~ Wave 7)\WVS_TimeSeries_1981_2020_stata_v2_0.dta", clear
	
	rename S020 year
	rename S002VS wave
	
	* Drop Wave 1 and Wave 2 since two do not include our DV
	drop if wave == 1 | wave == 2 
	
	kountry COW_NUM, from(cown)
	tab NAMES_STD,m
	
	tab COW_NUM if NAMES_STD =="341"
	tab COW_NUM if NAMES_STD =="348"
	tab COW_NUM if NAMES_STD =="446"
	tab COW_NUM if NAMES_STD =="667"
	tab COW_NUM if NAMES_STD =="714"
	
	replace NAMES_STD = "Montenegro" if NAMES_STD == "341"
	replace NAMES_STD = "Serbia" if NAMES_STD == "348"
	replace NAMES_STD = "Macao" if NAMES_STD == "446"
	replace NAMES_STD = "Palestine" if NAMES_STD == "667" 
	replace NAMES_STD = "Hong Kong" if NAMES_STD == "714" 
	
	rename NAMES_STD country_name
	
	preserve
		keep country_name COW_NUM COW_ALPHA year wave
		order country_name COW_NUM COW_ALPHA year wave
		
		duplicates drop
		save "data/mkdata/wvs_country.dta", replace
		
	restore
	save "data/mkdata/wvs_processed.dta", replace
	
******************************************************************************** */
**# 2. Merging it with other country-level dataset
	*UN: International Migration Stock
	use "data/country_level/cnt_mig_un.dta", clear
	
	/*Interpolation - Migrant stock is measured by every 5 year. So, there is a lot of missing. However, many papers found that
	migrant stock tend to have a linear trend, and so it is okay to use interpolation to fill the missing values. Furthermore, 
	this is the way many previous articles use Migrant stock data. So, I also did the interpolation to fill the missing values*/
	
	by country_name : ipolate cnt_all_mig_un year, gen(cnt_all_mig_ipo_un)
	by country_name : ipolate cnt_male_mig_un year, gen(cnt_male_mig_ipo_un)
	by country_name : ipolate cnt_female_mig_un year, gen(cnt_female_mig_ipo_un)
	
	drop cnt_all_mig_un
	drop cnt_male_mig_un
	drop cnt_female_mig_un
	
	*Vdem: Quality of Democracy
	merge 1:1 country_name year using "data/country_level/cnt_libdem_vdem.dta"
	
	drop _merge
	
	*WB: GDP pc, Unemployment Rate
	merge 1:1 country_name year using "data/country_level/cnt_vars_wb.dta"
	
	gen cnt_all_mig_prop =    cnt_all_mig_ipo_un/cnt_population_wb
	gen cnt_male_mig_prop =   cnt_male_mig_ipo_un/cnt_population_wb
	gen cnt_female_mig_prop = cnt_female_mig_ipo_un/cnt_population_wb
	
	drop _merge
	
	*Swiid: Gini
	merge 1:1 country_name year using "data/country_level/cnt_gini_swiid.dta"
	
	drop _merge
	
	*Lag the variables
	sort country_name year

	by country_name: gen cnt_all_mig_ipo_un_lag    =cnt_all_mig_ipo_un[_n-1]
	by country_name: gen cnt_male_mig_ipo_un_lag   =cnt_male_mig_ipo_un[_n-1]
	by country_name: gen cnt_female_mig_ipo_un_lag =cnt_female_mig_ipo_un[_n-1]
	by country_name: gen cnt_all_mig_prop_lag      =cnt_all_mig_prop[_n-1]
	by country_name: gen cnt_male_mig_prop_lag     =cnt_male_mig_prop[_n-1]
	by country_name: gen cnt_female_mig_prop_lag   =cnt_female_mig_prop[_n-1]
	by country_name: gen cnt_gdppc_wb_lag          =cnt_gdppc_wb[_n-1]
	by country_name: gen cnt_unemployment_wb_lag   =cnt_unemployment_wb[_n-1]
	by country_name: gen gini_disp_mean_lag        =gini_disp_mean[_n-1]
	by country_name: gen cnt_libdem_vdem_lag       =cnt_libdem_vdem[_n-1]
	by country_name: gen cnt_regime_vdem_lag       =cnt_regime_vdem[_n-1]
	
	replace country_name = "Macedonia" if country_name == "north macedonia"
	replace country_name = "Serbia" if country_name == "Yugoslavia"
	
	save "data/mkdata/mkdata_country_level", replace
	
	use "data/mkdata/wvs_country.dta", clear
	merge 1:1 country_name year using "data/mkdata/mkdata_country_level"
	
	keep if _merge == 3
	drop _merge
	save "data/mkdata/wvs_country.dta", replace
	
	mdesc
	
	**# 2.2 Merge it to the main data
	use "data/mkdata/wvs_processed.dta", clear
	
	merge m:1 country_name year using "data/mkdata/wvs_country.dta"
	drop if _merge == 1 // Drop Macao
	
	**# 3.3 Drop non-democracy
	keep if cnt_regime_vdem_lag==2 | cnt_regime_vdem_lag==3
	
******************************************************************************** */
**# 3. Generating and recoding the variables at an individual-level
		unique country_name
		unique S024
		
	** 3.1 Dependent Variable
		*Support for a strong leader
		tab E114, m
		tab E114, nolab
		
		tab S024 if E114 == -4
		drop if E114 == -4 // Drop "Not Asked" : Israel (2001), Poland (1997)
		recode E114 (1/2=1)(3/4=0)(-5/-1=.), gen(sup_strong)
		recode E114 (1=1)(4=0)(2/3=.)(-5/-1=.), gen(sup_strong_robust)
		
		*Support for democracy
		tab E117, m
		tab E117, nolab
		
		drop if E117 == -4 // Drop "Not Asked" : Israel (2001), Poland (1997), UK (1998)
		recode E117 (1/2=1)(3/4=0)(-5/-1=.), gen(sup_dem)
		recode E117 (1=1)(4=0)(2/3=.)(-5/-1=.), gen(sup_dem_robust)
		
		*Check missing
		recode E114 (-5=.)(-3/-1=.), gen(missing_sup_strong)
		recode E117 (-5=.)(-3/-1=.), gen(missing_sup_dem)
		
		bysort S024: egen missing_sup_dem_group = total(missing(missing_sup_dem))
		bysort S024: egen missing_sup_str_group = total(missing(missing_sup_strong))
		bysort S024: gen sample_size = _N
		
		gen prop_mis_dem = missing_sup_dem_group/sample_size
		gen prop_mis_str = missing_sup_str_group/sample_size
		
		summarize prop_mis_dem // mean: 0.071 std: 0.06  
		summarize prop_mis_str // mean: 0.089 std: 0.07
		
		tab S024 if prop_mis_dem >0.19 // Bulgaria (3), India(3~5), Moldova(4), Ukraine(3)
		tab missing_sup_dem_group if prop_mis_dem >0.191 // 0.012 (1.2% of total sample)
		
		tab S024 if prop_mis_str >0.228 // Bulgaria (3), India(3~5), Ukraine(3)
		tab missing_sup_str_group if prop_mis_str >0.229 // 0.013 (1.3% of total sample)
		
		bigtab S024 prop_mis_dem
		bigtab S024 prop_mis_str
		
		/* In 1.2 ~ 1.3% of total sample We can find uncommon proportion of missing. It is very small number of obs and there is no typical pattern or similarites among missing. */
		
		*Pure democracy supporters
		gen pure_sup_dem = .
		replace pure_sup_dem =1 if sup_dem==1 & sup_strong==0
		
		*Pure authoritarian strongmen leader supporters
		gen pure_sup_strong = .
		replace pure_sup_strong =1 if sup_dem==0 & sup_strong==1

		*Guardianship democracy supporters
		gen confused_sup = .
		replace confused_sup =1 if sup_dem==1 & sup_strong==1
		
		*Political pessimists
		gen pessimist_sup = .
		replace pessimist_sup =1 if sup_dem==0 & sup_strong==0
		
		*Combine
		gen dem_auto_four = 0     if pure_sup_dem    ==1
		replace dem_auto_four = 1 if pure_sup_strong ==1
		replace dem_auto_four = 2 if confused_sup    ==1
		replace dem_auto_four = 3 if pessimist_sup   ==1

		label define newlabel 0 "Pure Democracy" 1 "Pure Strong leader" 2 "Guardianship Democracy" 3 "Political Pessimist", modify
		label values dem_auto_four newlabel
		
		tab dem_auto_four,m
		drop if dem_auto_four ==.
		
		*Robustness
			*Pure democracy supporters
			gen robust_pure_sup_dem = .
			replace robust_pure_sup_dem =1 if sup_dem_robust==1 & sup_strong_robust==0
			
			*Pure authoritarian strongmen leader supporters
			gen robust_pure_sup_strong = .
			replace robust_pure_sup_strong =1 if sup_dem_robust==0 & sup_strong_robust==1

			*Guardianship democracy supporters
			gen robust_confused_sup = .
			replace robust_confused_sup =1 if sup_dem_robust==1 & sup_strong_robust==1
			
			*Political pessimists
			gen robust_pessimist_sup = .
			replace robust_pessimist_sup =1 if sup_dem_robust==0 & sup_strong_robust==0
			
			*Combine
			gen robust_dem_auto_four = 0     if robust_pure_sup_dem    ==1
			replace robust_dem_auto_four = 1 if robust_pure_sup_strong ==1
			replace robust_dem_auto_four = 2 if robust_confused_sup    ==1
			replace robust_dem_auto_four = 3 if robust_pessimist_sup   ==1

			label define newlabel2 0 "(Robust) Pure Democracy" 1 "(Robust) Pure Strong leader" 2 "(Robust) Guardianship Democracy" 3 "(Robust) Political Pessimist", modify
			label values robust_dem_auto_four newlabel2
			
			tab robust_dem_auto_four,m

	** 2.2 Independent variables
		*Economic anxiety
		tab C006, m
		tab C006, m nolab
			
		recode C006 (-5/-1=.)(1=10)(2=9)(3=8)(4=7)(5=6)(6=5)(7=4)(8=3)(9=2)(10=1), gen(econ_anxiety)
	
		tab econ_anxiety,m
		
		*Cultural attitudes
			*1.Abortion
			tab F120,m
			tab F120,m nolab
			tab S024 if F120==-4 // : Bangladesh(3), Peru(5), Turkey (3), Turkey(4)
			
			recode F120 (-5/-2=.)(-1=5), gen(abortion) // Higher - justifiable
			
			*2.Homosexuality
			tab F118,m
			tab F118,m nolab
			tab S024 if F118==-4 // : Bangladesh(3), Peru(5), Turkey (3), Turkey(4)
									
			recode F118 (-5/-2=.)(-1=5), gen(homosex) // higher - justifiable
			
			*3.Euthanasia
			tab F122,m
			tab F122,m nolab
			tab S024 if F122==-4 // : Does not exist in 21 countries
			
			recode F122 (-5/-2=.)(-1=5), gen(euthanasia) // higher - justifiable
			
			*4.immigration attitude
			tab C002,m
			tab C002,m nolab
			tab S024 if C002==-4 // : Colombia(3), Colombia(5), Lebanon (6), Tunisia(6)
			
			recode C002 (1=1)(2=3)(3=2)(-5/-2=.)(-1=2), gen(immigration) // Higher - Employer should not give priority to the native than immigrants
			
			*5.Men's priority
			tab C001,m
			tab C001,m nolab
			tab S024 if C001==-4 // : Colombia(3), Colombia(5)
			
			recode C001 (1=1)(2=3)(3=2)(-5/-2=.)(-1=2), gen(men_prior) // Higher - Employer should not give priority to men than women
			
			*6.Religiosity
			*How often go to the church
			tab F028, m
			tab F028, m nolab
			tab S024 if F028==-4
			
			recode F028 (-5/-1=.), gen(religiosity) // Higher - never go to the church

			*7.The importance of religion
			tab A006,m
			tab A006,m nolab
			tab S024 if A006==-4 // : Colombia (5)
			
			recode A006 (-5/-1=.), gen(reli_imp) // Higher - Not at all important
			
			*8.Religious child
			tab A040,m
			tab A040,m nolab
			
			recode A040 (-5/-2=.)(-1=0)(0=1)(1=0), gen(child_religiosity) // Higher - Not important
			
			*9.How religious you are?
			tab F034,m
			tab F034,m nolab
			tab S024 if F034==-4 // : Colombia (3), South Korea (3)
			
			recode F034 (-5/-2=.)(-1=2), gen(religious) // Higher - Atheist
			
			*10.God's importance
			tab F063,m
			tab F063,m nolab
			tab S024 if F063==-4 // : Colombia (3), South Korea (3)
			
			recode F063 (-5/-2=.)(-1=5)(1=10)(2=9)(3=8)(4=7)(5=6)(6=5)(7=4)(8=3)(9=2)(10=1), gen(god_imp) // Higher - not important
			
			*11.University for boy
			tab D060,m
			tab D060, m nolab
			tab S024 if D060==-4 // : Colombia (3), Switerzerland (3)
			
			recode D060 (-5/-1=.), gen(univ_men) // Higher -  University is not more important for a boy than for a girl

			*12.Men Leaders
			tab D059,m
			tab D059,m nolab
			tab S024 if D059==-4 // : Colombia (3), Switerzerland (3)
			
			recode D059 (-5/-1=.), gen(leader_men) // Higher - Men do not make better leaders than women do
			
			*13.Neighbor immigrants
			tab A124_06,m
			tab A124_06,m nolab
			tab S024 if A124_06==-4 // : Colombia (3,5), Japan (3,4,5)
			
			recode A124_06 (-5/-2=.)(-1=0)(0=1)(1=0), gen(immig_neighbor) // Higher - it is okay to have immigrants in their neighbor
			
			*14.Neightbor race
			tab A124_02,m
			tab A124_02,m nolab
			tab S024 if A124_02==-4 // : Colombia (3), Japan (3,4,5), South Korea (3)
				
			recode A124_02 (-5/-2=.)(-1=0)(0=1)(1=0), gen(diffrace_neighbor) // Higher - it is okay to have people of difference race in their neighbor
		
		*Build Cultural attitudes
		egen comb = rowtotal(abortion homosex euthanasia immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor)
		egen missing = rowmiss(abortion homosex euthanasia immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor)
		
		replace comb = . if missing !=0
		drop missing
		revrs comb
		
		egen culture_conserv = std(revcomb)
		
		tab culture_conserv,m
		
		mdesc abortion homosex euthanasia immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor
		/* Euthanasia has too many missing. Thus, we can drop it and create a new var*/

		egen comb_2 = rowtotal(abortion homosex immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor)
		egen missing = rowmiss(abortion homosex immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor)
		
		replace comb_2 = . if missing !=0
		drop missing
		revrs comb_2
		
		egen culture_conserv_2 = std(revcomb_2)
		tab culture_conserv_2,m
		
		pwcorr culture_conserv culture_conserv_2, sig
		
		alpha abortion homosex immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor
		alpha abortion homosex euthanasia immigration men_prior religiosity reli_imp child_religiosity religious god_imp univ_men leader_men immig_neighbor diffrace_neighbor
		
		tab S024 if F120==-4| F118==-4| C002==-4| C001==-4| F028==-4| A006==-4| A040==-4| F034==-4| F063==-4| D060==-4| D059==-4| A124_06==-4| A124_02==-4
		tab S024 if F120==-4| F118==-4| C002==-4| C001==-4| F028==-4| A006==-4| A040==-4| F034==-4| F063==-4| D060==-4| D059==-4| A124_06==-4| A124_02==-4, nolab
		
		/*Questions are not existed among these countries. (N=22734)
		  In other words, among 39,552 missing over culture_conserv2, 57.48% are coming from the fact that those questions are not asked*/
	
		*Check missing
		bysort S024: egen missing_culture_cons_2 = total(missing(culture_conserv_2)) if S024!=503 & S024!=1703 & S024!=1705 & S024!=3923 & S024!=3924 & S024!=3925 & S024!=4103 & S024!=4226 ///
																						& S024!=6045 &S024!=7563 & S024!=7886 & S024 !=7923 & S024!=7924 
		gen prop_mis_cons_2 = missing_culture_cons_2/sample_size
		summarize prop_mis_cons_2 // mean: 0.08 std: 0.07  
	
		tab S024 if prop_mis_cons_2 >0.22 &  prop_mis_cons_2!=. // Germany (5), Guatemala (7) Japan (6), Japan(7)
		
		/* In 2.9% of total sample We can find uncommon proportion of missing. It is small number of obs and there is no typical pattern or similarites among missing. */
	
		*Confidence in political institutions
		*Parliament
		tab E069_07, m
		tab E069_07, m nolab
		recode E069_07 (1=4)(2=3)(3=2)(4=1)(-5/-1=.),gen(conf_parli)

		*Political Parties
		tab E069_12, m
		tab E069_12, m nolab
		recode E069_12 (1=4)(2=3)(3=2)(4=1)(-5/-1=.),gen(conf_party)
		
		*Government
		tab E069_11, m
		tab E069_11, m nolab
		recode E069_11 (1=4)(2=3)(3=2)(4=1)(-5/-1=.),gen(conf_gov)
		
		tab conf_party conf_gov,m
		
		*Confidence in democratic institutions
		gen conf_demo_inst = (conf_parli + conf_party + conf_gov)/3
		tab conf_demo_inst,m
		
	** 2.3 Control variables
		*Political interst
		tab E023,m
		tab E023,m nolab

		recode E023(4=1)(3=2)(2=3)(1=4)(-5/-1=.), gen(poli_interest)

		*Educ
		tab X025R,m
		tab X025R,m nolab
		recode X025R (-5/-1=.), gen(educ_three)

		tab X025, m
		tab X025, m nolab
		recode X025 (-5/-1=.)(1/2=1)(3/4=2)(5/6=3)(7/8=4), gen(educ_four)

		*Age
		tab X003,m
		recode X003 (-5/-1=.), gen(age)
		recode age (13/16 = 17)
		recode age (91/103 = 90)

		label define age 17 "17 or less" 90 "90 or more", modify
		label values age age

		*Gender
		tab X001,m
		recode X001 (-5/-1=.)(1=1)(2=0), gen(male)
		tab male,m
		
		*Marital status
		tab X007,m
		tab X007,m nolab
		recode X007 (-5/-4=.)(-2/-1=0)(1/2=1)(3/6=0), gen(married)
		
		*Income
		tab X047_WVS,m
		tab X047_WVS,m nolab
		recode X047_WVS (-5/-2=.)(-1=5), gen(income_tenth_mid)
		
		*Employment
		tab X028,m
		tab X028,m nolab
		
		recode X028 (-5/-4=.)(-3/-1=0)(1/3=1)(4/9=0), gen(employed)
		label define employed 1 "employed" 0 "unemployed", modify
		label value employed employed
		
		*Political ideology
		tab E033,m
		tab E033,m nolab

		recode E033 (-5/-2=.)(-1=5), gen(right_ideology_mid)
		
		*Social Trust
		tab A165,m
		tab A165,m nolab
		
		recode A165 (-4=.)(-2/-1=0)(2=0), gen(social_trust)
	
	** 2.4 Conception of Democracy		
		*Democracy:  Civil rights protect people's liberty against oppression.
		tab E229,m
		tab E229,m nolab
		
		recode E229 (-5/-1=.), gen(dem_essential_liberty)
		
		*Democracy: People Obey rules
		tab E233B,m
		tab E233B,m nolab
		
		recode E233B (-5/-1=.), gen(dem_essential_obeyrule)

	
		*Democracy may have problems but is better
		tab E123,m
		tab E123,m nolab
		
		recode E123 (-4/-1=.)(1=4)(2=3)(3=2)(4=1), gen(dem_essential_better)
		
		*Importance of Democracy
		tab E235,m
		tab E235,m nolab
		
		recode E235 (-5/-1=.), gen(dem_importance)

	** 2.5 Political interest/ participation
		*Political action
		*Signing a petition
		tab E025,m
		tab E025, nolab
		recode E025 (1=3)(2=2)(3=1)(-4/-1=.),gen(action_petition)
		tab action_petition

		*Political participation
		*Joining in boycotts
		tab E026,m
		tab E026, nolab
		recode E026 (1=3)(2=2)(3=1)(-5/-1=.),gen(action_boycotts)
		tab action_boycotts

		*Attending demonstrations
		tab E027,m
		tab E027, nolab
		recode E027 (1=3)(2=2)(3=1)(-5/-1=.),gen(action_demonstration)
		tab action_demonstration

		*Election at local level
		tab E263,m nolab
		tab E263, nolab
		recode E263 (3=1)(2=2)(1=3)(-5/-1=.)(4=.),gen(action_vote_local)
		tab action_vote_local

		*Election at national level
		tab E264,m
		tab E264, nolab
		recode E264 (3=1)(2=2)(1=3)(-5/-1=.)(4=.),gen(action_vote_national)
		tab action_vote_national

	save "data/mkdata/wvs_processed.dta", replace
	
******************************************************************************** */
**# 4 Trim the final dataset
	
	rename S025 country_year
	rename S007 idno
	rename S018 equal_weight
	
	mdesc country_name wave year country_year idno sup_strong sup_dem pure_sup_dem pure_sup_strong confused_sup pessimist_sup dem_auto_four ///
		  econ_anxiety culture_conserv culture_conserv_2 conf_parli conf_party conf_gov conf_demo_inst conf_gov ///
		  poli_interest educ_three educ_four age male married income_tenth_mid employed right_ideology_mid social_trust ///
		  dem_essential_liberty dem_essential_obeyrule dem_essential_better dem_importance ///
		  action_petition action_boycotts action_demonstration action_vote_local action_vote_national ///
		  cnt_all_mig_ipo_un cnt_all_mig_ipo_un_lag cnt_all_mig_prop cnt_all_mig_prop_lag cnt_male_mig_ipo_un cnt_male_mig_ipo_un_lag ///
		  cnt_male_mig_prop cnt_male_mig_prop_lag cnt_female_mig_ipo_un cnt_female_mig_ipo_un_lag cnt_female_mig_prop cnt_female_mig_prop_lag ///
		  cnt_gdppc_wb cnt_gdppc_wb_lag cnt_unemployment_wb cnt_unemployment_wb_lag ///
		  gini_disp_mean gini_disp_mean_lag cnt_libdem_vdem cnt_libdem_vdem_lag cnt_libdem_vdem_lag cnt_regime_vdem cnt_regime_vdem_lag equal_weight
	
	label data "Support for a strong leader or democracy, or both?"
	label variable country_name "Country name"
	label variable wave "Wave"
	label variable year "Year"
	label variable country_year "Country-Year"
	label variable idno "Individual's ID"
	label variable sup_strong "Support for strong leader"
	label variable sup_dem    "Support for democracy"
	label variable pure_sup_dem    "Pure support for democracy"
	label variable pure_sup_strong "Pure support for strong leader"
	label variable confused_sup    "Support Demo & Strong leader"
	label variable pessimist_sup    "Reject Demo & Reject leader"
	label variable dem_auto_four  "Types of Support (DV)"
	label variable robust_dem_auto_four "Types of Robust Support (DV)"
	label variable econ_anxiety "Economic Anxiety"
	label variable culture_conserv "Cultural conservatism (Standardized)"
	label variable culture_conserv_2 "Cultural conservatism (Standardized) (less missing)"
	label variable conf_parli "Confidence in parliament"
	label variable conf_party "Confidence in Political parties"
	label variable conf_gov   "Confidence in government"
	label variable conf_demo_inst "Confidence in Democratic Institutions"
	label variable poli_interest "Political Interest"
	label variable educ_three  "Education (Three)"
	label variable educ_four   "Education (Four)"
	label variable age  "Age"
	label variable male "Male"
	label variable married "Married"
	label variable income_tenth_mid "Income (Dk - Mid)"
	label variable employed "Employment"
	label variable right_ideology "Political Ideology (Right)"
	label variable right_ideology_mid "Political Ideology (Right)"
	label variable social_trust "Social Trust"
	label variable dem_essential_obeyrule "Conception_obey_ruler"
	label variable dem_essential_better "Conception_problematic_but_good"
	label variable dem_importance "Importance of Democracy"
	label variable action_petition "Signing a petition"
	label variable action_boycotts "Boycotting"
	label variable action_demonstration "Particiapting demontrations"
	label variable action_vote_local "Voting at local election"
	label variable action_vote_national "Voting at national election"
	label variable cnt_all_mig_ipo_un "Migration"
	label variable cnt_male_mig_ipo_un "Male Migration"
	label variable cnt_female_mig_ipo_un "Female Migration"
	label variable cnt_all_mig_prop "Migration (%)"
	label variable cnt_male_mig_prop "Male Migration (%)"
	label variable cnt_female_mig_prop "Female Migration (%)"
	label variable cnt_gdppc_wb  "GDP per capita"
	label variable cnt_unemployment_wb "Unemployment (%)"
	label variable gini_disp_mean "Gini coef"
	label variable cnt_libdem_vdem "Quality of Democracy"
	label variable cnt_regime_vdem "Regime Type"
	label variable cnt_all_mig_ipo_un_lag "Migration (Lag)"
	label variable cnt_male_mig_ipo_un_lag "Male Migration (Lag)"
	label variable cnt_female_mig_ipo_un_lag "Female Migration (Lag)"
	label variable cnt_all_mig_prop_lag "Migration (%) (Lag)"
	label variable cnt_male_mig_prop_lag "Male Migration (%) (Lag)"
	label variable cnt_female_mig_prop_lag "Female Migration (%) (Lag)"
	label variable cnt_gdppc_wb_lag  "GDP per capita (Lag)"
	label variable cnt_unemployment_wb_lag "Unemployment (%) (Lag)"
	label variable gini_disp_mean_lag "Gini coef (Lag)"
	label variable cnt_libdem_vdem_lag "Quality of Democracy (Lag)"
	label variable cnt_regime_vdem_lag "Regime Type (Lag)"
	label variable equal_weight "Equilibrated Weight"

	
	keep country_name wave year country_year idno sup_strong sup_dem pure_sup_dem pure_sup_strong confused_sup pessimist_sup dem_auto_four robust_dem_auto_four ///
		  econ_anxiety culture_conserv culture_conserv_2 conf_parli conf_party conf_gov conf_demo_inst conf_gov ///
		  poli_interest educ_three educ_four age male married income_tenth_mid employed right_ideology_mid social_trust ///
		  dem_essential_liberty dem_essential_obeyrule dem_essential_better dem_importance ///
		  action_petition action_boycotts action_demonstration action_vote_local action_vote_national ///
		  cnt_all_mig_ipo_un cnt_all_mig_ipo_un_lag cnt_all_mig_prop cnt_all_mig_prop_lag cnt_male_mig_ipo_un cnt_male_mig_ipo_un_lag ///
		  cnt_male_mig_prop cnt_male_mig_prop_lag cnt_female_mig_ipo_un cnt_female_mig_ipo_un_lag cnt_female_mig_prop cnt_female_mig_prop_lag ///
		  cnt_gdppc_wb cnt_gdppc_wb_lag cnt_unemployment_wb cnt_unemployment_wb_lag ///
		  gini_disp_mean gini_disp_mean_lag cnt_libdem_vdem cnt_libdem_vdem_lag cnt_libdem_vdem_lag cnt_regime_vdem cnt_regime_vdem_lag equal_weight ///
		  E069_07 E069_12 E069_11
		 
    order country_name wave year country_year idno sup_strong sup_dem pure_sup_dem pure_sup_strong confused_sup pessimist_sup dem_auto_four robust_dem_auto_four ///
		  econ_anxiety culture_conserv culture_conserv_2 conf_parli conf_party conf_gov conf_demo_inst conf_gov ///
		  poli_interest educ_three educ_four age male married income_tenth_mid employed right_ideology_mid social_trust ///
		  dem_essential_liberty dem_essential_obeyrule dem_essential_better dem_importance ///
		  action_petition action_boycotts action_demonstration action_vote_local action_vote_national ///
		  cnt_all_mig_ipo_un cnt_all_mig_ipo_un_lag cnt_all_mig_prop cnt_all_mig_prop_lag cnt_male_mig_ipo_un cnt_male_mig_ipo_un_lag ///
		  cnt_male_mig_prop cnt_male_mig_prop_lag cnt_female_mig_ipo_un cnt_female_mig_ipo_un_lag cnt_female_mig_prop cnt_female_mig_prop_lag ///
		  cnt_gdppc_wb cnt_gdppc_wb_lag cnt_unemployment_wb cnt_unemployment_wb_lag ///
		  gini_disp_mean gini_disp_mean_lag cnt_libdem_vdem cnt_libdem_vdem_lag cnt_libdem_vdem_lag cnt_regime_vdem cnt_regime_vdem_lag equal_weight ///
		  E069_07 E069_12 E069_11
	
	sort country_name year idno
	
	describe
	summarize
	mdesc 
	save "data/Data_support_for_a_strong_leader_or_democracy.dta", replace

log close
clear